import axios from '../../utils/request'

function getBlog(query) {
    // { params: query } === ?pageIndex=1&pagesize=10
    return axios.get('/blog/list', { params: query })
}

function addBlog(body) {
    return axios.post('/blog/list', body)
}


function editBlog(body) {
    return axios.put('/blog/list', body)
}

function delBlog(id) {
    return axios.delete(`/blog/list/${id}`)
}

export default {
    getBlog,
    addBlog,
    editBlog,
    delBlog,
}